package com.rizzo.shell.intern.host;

import com.google.common.base.Strings;
import com.rizzo.shell.intern.RizzoCommands;

/**
 * Created with IntelliJ IDEA.
 * User: jalie
 * Date: 1/20/13
 * Time: 4:01 PM
 * To change this template use File | Settings | File Templates.
 */
public class RedisHost implements Host {

    private int node;
    private String host;
    private String port;
    private String password;

    public RedisHost(int node, String host, String port, String password) {
        this.node = node;
        this.host = host;
        this.port = port;
        this.password = password;
    }

    public int getNode() {
        return node;
    }

    public void setNode(int node) {
        this.node = node;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return Strings.padEnd(String.valueOf(node), RizzoCommands.WIDE_TAB_PADDING, ' ')
                + Strings.padEnd(host, RizzoCommands.WIDE_TAB_PADDING, ' ')
                + Strings.padEnd(port, RizzoCommands.WIDE_TAB_PADDING, ' ');
    }
}